import Vue from 'vue'
import App from './App.vue'
import router from './router'
import axios from 'axios'
// vant ui按需导入
import './plugins/vant.js'
import 'vant/lib/index.css'

import 'amfe-flexible/index.js'
Vue.prototype.$http = axios
Vue.config.productionTip = false

// eslint-disable-next-line eqeqeq
axios.defaults.baseURL = 'http://www.sxwby.com/home/'

// 阻止用户多次点击
Vue.directive('noClick', {
  inserted (el, binding) {
    el.addEventListener('click', e => {
      el.classList.add('is-disabled')
      el.disabled = true
      setTimeout(() => {
        el.disabled = false
        el.classList.remove('is-disabled')
      }, binding.value || 1000)
    })
  }
})

new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
